package cn.itcast.nems.order.dao.mapper;

import cn.itcast.nems.order.dao.dataobject.OrderRefundDO;
import cn.itcast.nems.order.dao.entity.OrderRefund;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 退费单-头 Mapper 接口
 * </p>
 *
 * @author liyong
 * @since 2023-08-31
 */
@Mapper
public interface OrderRefundMapper extends BaseMapper<OrderRefund> {

    /**
     * 修改退款单实际金额
     *
     * @param orderRefundId 退款单ID
     * @param amount        实际退款金额
     */
    void updateOrderRefundAmount(@Param("orderRefundId") String orderRefundId, @Param("amount") int amount);

    List<Map<String, Object>> listOrderRefund(String studentRecordId);

    IPage<OrderRefundDO> listPage(Page<OrderRefundDO> page, OrderRefundDO orderRefundDO);

    Map<String, Object> orderRefundInfo(String orderRefundId);
    // 付费渠道
    List<Map<String, Object>> paymentchannels(String schoolId);

    String paymentchannel(String schoolId, String name);

    List<Map<String, Object>> incomeexpensestypes();
    // 退费类型
    String incomeexpensestypeById(@Param("id") Integer id);
    // 退费方式
    List<Map<String, Object>> studentCostTypes();

    String studentCostType(Integer id);

    IPage<Map> searchClazzes(Page<?> objectPage, @Param("params") OrderRefundDO params);
}
